#ifndef LINESEGMENT_H_
#define LINESEGMENT_H_

#include "Vector2D.h"

class Object;
class LineSegment
{
	protected:
	
	public:
	Vector2D left;
	Vector2D midpoint;
	Vector2D right;
	Vector2D normal;
	Vector2D direction; //from left to right
	float length;
	float maxStaticFrictionalForce;
	
	LineSegment();
	LineSegment(Vector2D left, Vector2D right);
	LineSegment(Vector2D left, Vector2D right, float staticFrictionalForce);
	bool Collide(Object * object, float * distance, float * error, Vector2D * resultantForce, Vector2D * origin);	
	bool Collide(Object * object, float * distance, Vector2D * resultantForce, Vector2D * origin);
	bool Collide(Object * object, Vector2D * origin);
	bool Collide(LineSegment * segment, Vector2D * origin);
	void Draw();
	void ProjectLine(Vector2D axis, float * min, float * max, Vector2D * minVertex, Vector2D * maxVertex, float * minError, float * maxError);
	
};
#endif /*LINESEGMENT_H_*/
